<template>
    <div class="container-v3">
        <iframe v-show="iframeState" id="show-iframe" frameborder=0 name="showHere" scrolling=auto :src="url"></iframe>
    </div>
</template>

<script>
// import axios from '@/libs/api.request'
import xeUtils from 'xe-utils'

export default {
  components: {},
  data () {
    return {
      iframeState: false,
      url: '',
      request_url: '',
      browse_url: ''
    }
  },
  methods: {},
  mounted () {
    let urlInfo = xeUtils.locat()
    console.log(urlInfo, '9999')
    if (urlInfo.protocol === 'https:') {
      location.href = 'http' + urlInfo.href.slice(5)
    } else {
      const oIframe = document.getElementById('show-iframe')
      const deviceWidth = document.documentElement.clientWidth
      const deviceHeight = document.documentElement.clientHeight
      oIframe.style.width = deviceWidth + 'px'
      oIframe.style.height = deviceHeight + 'px'
      this.url = this.$route.query.request_url
      let that = this
      setTimeout(function () {
        that.url = that.$route.query.browse_url
        that.iframeState = true
      }, 2000)
    }
  }
}
</script>
